package com.azure.mapper.bigstore;

import com.azure.entity.TOrder;
import com.azure.entity.TOrderExample;

import java.time.LocalDate;
import java.util.List;

import net.minidev.json.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface TOrderMapper {
    int countByExample(TOrderExample example);

    int deleteByExample(TOrderExample example);

    int deleteByPrimaryKey(Long id);

    int insert(TOrder record);

    int insertSelective(TOrder record);

    List<TOrder> selectByExample(TOrderExample example);

    TOrder selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") TOrder record, @Param("example") TOrderExample example);

    int updateByExample(@Param("record") TOrder record, @Param("example") TOrderExample example);

    int updateByPrimaryKeySelective(TOrder record);

    int updateByPrimaryKey(TOrder record);

    @Select("select uid,sum(total) total from t_order where date >= #{date} group by uid")
    List<JSONObject> totalDailyReport(@Param("date")LocalDate date);
    @Select("select uid,sum(total) total from t_order where date between #{startDate} and #{stopDate} group by uid")
    List<JSONObject> totalMonthlyReport(@Param("startDate")LocalDate startDate,@Param("stopDate")LocalDate stopDate);
}